1. Field of the Invention
The present invention relates generally to maintaining and improving file system integrity. More specifically, the present invention relates to a method, apparatus, and computer usable code to obtain file system metadata in a dense format so that such data may be transmitted off-site for expert review and remedies.
2. Description of the Related Art
In computing, a file system is a structure for storing and organizing computer files and the data they contain to make it easy to find and access the files. File systems may use a storage device such as a hard disk or CD-ROM and involve maintaining the physical location of the files. Alternatively, a file system may be a virtual file system. A virtual file system exists only as an access method for virtual data or for data over a network.
File systems are made of two types of data. The first type of data, which usually predominates, is user data. The content type of user data may be, for example, text, graphics, music, and computer instructions. The second type of data is file system metadata. File system metadata is all the data that is not the user data. Metadata informs a processing system of the statistics and structure of the files containing user data.
File system metadata includes a superblock, which provides a file system summary and includes pointers to other information. An inode is file system metadata that is associated with each file. The inode denotes the length of the file in bytes, an associated device identifier, a user identifier, a group identifier, an inode number that may be unique, the file mode, a timestamp, and a reference count.
A block is the smallest unit of disk storage that may be allocated to a file. For example, a processor may establish a block to be 1024 bytes on a particular file system. This means that a file will nearly always fill one or more blocks, with the final block being only part occupied by data.
Parts of a file may reside in numerous blocks, sometimes scattered about a disk drive. An inode may have several blocks listed within the inode. For larger files, an inode may include an indirect block, which may point to a list of additional blocks. Often this leads to a tree-like structure of multiple levels of indirect blocks pointing to successively deeper tiers of blocks.
File systems tend to be very large data structures. When a processor makes changes to the file system, the processor often requires many separate write operations. Occasionally an error or other fault interrupts the sequence of writes, for example, a power failure may occur.
A race condition may happen when a processor encounters an error in this situation. A race condition is what happens when two events in an electronic device essentially race each other to see which influences the device's state or output, wherein the first event or signal to arrive controls the device's state. In the context of file systems, such as a journaling file system, two steps occur when updating the file system: 1) removing a file's directory entry; and 2) marking the file's inode as free space in a free space map.
If power fails, and step 1 happens immediately prior to the crash, an orphaned inode will be present, and more of the blocks will appear to be allocated to storage than is actually allocated. If step 2 happens immediately prior to the crash, the not-yet-deleted inode will be marked free and possibly be overwritten by something else.
Journaling file systems, a particular type of file system, have additional failure modes. In addition to the two steps noted above, a journaling file system has a third step of committing changes made for the transaction. When things function correctly, a processor either commits all of a transaction, or commits none of the transaction to a journal log. In a journaling file system, the processor may replay the journal log to establish the metadata in a consistent state. However, a journaling file system can become inconsistent when I/O error handling fails, such as occurs when a write fails, but the processor writes other parts of the transaction to the journal log.
A hazard involved with remotely outsourcing maintenance and recovery of file systems is that transmitted details of the file system may be intercepted. This is especially true where data is transmitted via the internet. Even encrypted data, once intercepted, may be subject to compromise. Consequently, there is a long standing desire to avoid transmitting sensitive information over the internet where possible.